package com.spsyry.pay.config;

import org.jdom2.output.support.SAXOutputProcessor;

import java.io.FileWriter;
import java.io.IOException;


public class AlipayConfig {

    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    //public static String app_id = "2021000122669503";


    //arhat
    public static String app_id = "9021000149666087";



    // 商户私钥，您的PKCS8格式RSA2私钥
    //public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDnS97J1eX2pXu+0E0ksZCN9hw8sWUkaXRa2H33JODPOO/YdfOqa64tPLSG/+s82l/gA49Hv5S/29k/ptkBfuPYO9KDDGBZd08No5uqJNUikZG3Cg3f3bcOAv5DhWfDyWLrwAS48Vp5DFCvjhkmrpyQu6nmqEquHARy1zsKLhwy5HyBKAFMJng5oXrP7w7+qALaIGBS8bXfhnRz2rhpe1mZSH5OWPyQUQuUf0Fp5DRJkyuU/x5ebatyvdqX1tuho7nT86nXGDbuI6a6doez//P2zSL3Hg6+E2Jv5m0F6NNwAuLq2ZW8hMvYzQNSj/HtO1+tkCTy1SiEdrTHMYZYnXS7AgMBAAECggEAGPDyfjtFh/pCRMo7d1h6aQR/+P98E5gXhvBPbQYaA9505peZhegEqTYhlWklWbOGoSZhHfCHvsSbQaThQ6sGMLwKsDz2as9Vw/e/gnJkVUzzNJSt+FT1N1qVRnytOsyNkTRsjfDgu6rbTIL7LVOo6GaEJK5DF1FIHYYeBLQCMG6EgdrWnDKxnTcJ+sivvlLR3ea7CKV+utwpJs2PMZ/KvCSZcDWF1qdeq9nDZz236Zjn4KDpHPMpKFOo1rGslKU9AUQZRUp1YpkCYvYjqq5s3numrqwM128jPPjzbAJ5mdICLP0qgrNXyUfmj6vxCZ+zTv87y2mxDNHI0hejHJW3KQKBgQD+pw89OVFHbi+BeASMVTxUtBqDiJIruO9hj0WDmCCZSxEVOXcCz2vuBrtElvzvAVWyzvzQdZZe61JoR6AQ2evnA8K2KRhnCtRiBJak6bOHeH6MjrT6f1yRC4iXHiZd8PPeHb2Noey7MxMvDMPThRcsWtsQ/wbxlQoZXuZDimEWhQKBgQDohSxrSRYcsXwS2h6npZi8pgT1jferdvDECHStONlX8cuMaFiJjyaiWHaaOFQC+sMWZ28Ys1PDXVVOp8lrdhxARBtFIotAsItm6FpNen3+2DKm/LAY3Tv0onwtdjwwJssPtHbdeORouSdXmkqW+nZlk+RlG8etaGJw4lGFO9JiPwKBgBi7Zup+T5uNYwXC/0YV3Sco2s5djDy82Fr0TD8MnlXlCYKzMxDNzmCuvK9brrMTwRv9qGYilXkgh79i/XPFhnjIT7fbY+hWD+x5H5xiqjIFDN1f2sndZsMbiKeMoRNMnJK89rTzvgcsXbebGMXJTkfbhx0ud6Es5W8zXU+/98/1AoGAP/ZCXdDhEEuSge0Wea+H8H0K6DGBa91wJbzdu7jjsNmG0LzzfgOu8QG8vne4RImOmN8jJHxQEnHeQaDOO41mABe8GKyD+euWrVxFWwLTHgODC4R/PJe/InCAEFFyBRzmxw8xk4Lp8hTcybBbzGRhpVelgFq/9ue8DKl1G111ZikCgYB0hKL01AvOH90IZWLgPB6D0CLqEm89PcdfOn4wNje8d+3+Ni/ELsEoxwYeMOdtKf6+xun4V0Pi/EG1cp2AghxUWpbDst4rlFNyCoqq8dRS12UddVA1NqiMoR+EBXo6W7tEt2WLmz3olP9tlaU1nZIphCgjTeL5zHwtiYm2nEyHcA==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    //public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkPDPXCJ38XSn1S2YIViz2fgFmaMYEKt+LNxGEu81vB/NDedTcUYHjtxkSs1+WL+MtgsnWJj2pqCUKZ/9DqDuEPyaUmi9nSA+iFJWDYkxbzwQm0xVNorkwELAvcjATOkjh8ld4hfMC515RzOJTTf1X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uHi5te7TNjsbZX2FeHhDUrRU73RE8ha1FDMvjf03p8LFM1YWrGIJ6aMIxtNpJGIm8KK27w0DqQ16IqkkdinQIDAQAB";





    // 用来接收支付结果（异步回调路径）
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    // public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";
    public static String notify_url = "http://r486e29b.natappfree.cc/alipay/notify";

    // 支付完成之后的跳转路径（同步回调路径）
    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    //public static String return_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";
    public static String return_url = "http://localhost/paysuccess.html";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
